<?php
$this->pageTitle=Yii::app()->name . ' - '.UserModule::t("Login");
$this->breadcrumbs=array(
	UserModule::t("Login"),
);
?>

<div id="loginbox">
	<?php if(Yii::app()->user->hasFlash('loginMessage')): ?>
	<div class="success">
		<?php echo Yii::app()->user->getFlash('loginMessage'); ?>
	</div>
	<?php endif; ?>
	
	<?php echo CHtml::beginForm('/user/login', 'post', array('class'=> 'form-vertical')); ?>
		<p>Enter username and password to continue.</p>
		<?php echo CHtml::errorSummary($model); ?>
		<div class="control-group">
			<div class="controls">
				<div class="input-prepend">
					<span class="add-on"><i class="icon-user"></i></span>
					<!--input type="text" placeholder="Username" /-->
					<?php echo CHtml::activeTextField($model,'username', array("type"=>"text","placeholder"=>"Username")) ?>
				</div>
			</div>
		</div>
		<div class="control-group">
			<div class="controls">
				<div class="input-prepend">
					<span class="add-on"><i class="icon-lock"></i></span>
					<!--input type="password" placeholder="Password" /-->
					<?php echo CHtml::activePasswordField($model,'password', array("type"=>"password", "placeholder"=>"Password")) ?>
				</div>
			</div>
		</div>
		<div class="form-actions">
			<!--span class="pull-left"><a href="#" class="flip-link" id="to-recover">Lost password?</a></span-->
			<span class="pull-right"><input type="submit" class="btn btn-inverse" value="Login" /></span>
		</div>
	<?php echo CHtml::endForm(); ?>
	<!--form id="recoverform" action="#" class="form-vertical">
		<p>Enter your e-mail address below and we will send you instructions how to recover a password.</p>
		<div class="control-group">
			<div class="controls">
				<div class="input-prepend">
					<span class="add-on"><i class="icon-envelope"></i></span><input type="text" placeholder="E-mail address" />
				</div>
			</div>
		</div>
		<div class="form-actions">
			<span class="pull-left"><a href="#" class="flip-link" id="to-login">&lt; Back to login</a></span>
			<span class="pull-right"><input type="submit" class="btn btn-inverse" value="Recover" /></span>
		</div>
	<div style="clear: both;"></div-->
</div>

<?php
	$form = new CForm(array(
		'elements'=>array(
				'username'=>array(
						'type'=>'text',
						'maxlength'=>32,
				),
				'password'=>array(
						'type'=>'password',
						'maxlength'=>32,
				),
				'rememberMe'=>array(
						'type'=>'checkbox',
				)
		),

		'buttons'=>array(
				'login'=>array(
						'type'=>'submit',
						'label'=>'Login',
				),
		),
	), $model);
?>